package com.activemq.springtest.msg;


import org.springframework.jms.core.MessageCreator;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;


public class TxMessage implements MessageCreator {
    private String testMessage;

    public TxMessage(String testMessage) {
        this.testMessage = testMessage;
    }

    @Override
    public Message createMessage(Session session) throws JMSException {
        TextMessage textMessage=session.createTextMessage(testMessage);
        return textMessage;
    }
}
